package com.lion.uiwithzhihu.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class PreferenceUtils
{
	public static  boolean readMode(Context context)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		boolean isDark = sp.getBoolean("mode", false);
		return isDark;
	}
	public static void saveMode(Context context,boolean isDark)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		Editor edit = sp.edit();
		edit.putBoolean("mode", isDark);
		edit.commit();
	}
	public static  boolean getBigText(Context context)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		boolean isDark = sp.getBoolean("isBig", false);
		return isDark;
	}
	public static void setBigText(Context context,boolean isBig)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		Editor edit = sp.edit();
		edit.putBoolean("isBig", isBig);
		edit.commit();
	}
	public static  boolean getNoPic(Context context)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		boolean isDark = sp.getBoolean("isPic", false);
		return isDark;
	}
	public static void setNoPic(Context context,boolean isPic)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		Editor edit = sp.edit();
		edit.putBoolean("isPic", isPic);
		edit.commit();
	}
	public static  boolean getGuide(Context context)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		boolean isGuide = sp.getBoolean("Guide", false);
		return isGuide;
	}
	public static void setGuide(Context context,boolean isGuide)
	{
		SharedPreferences sp = context.getSharedPreferences(Contants.THEME_MODE,0);
		Editor edit = sp.edit();
		edit.putBoolean("Guide",isGuide);
		edit.commit();
	}
}
